﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DcsGauges.DataStructures
{
    struct URect
    {
        public ULoc            TopLeft;
        public USize            Size;

        public URect(ULoc topLeft, USize size)
        {
            this.TopLeft            = topLeft;
            this.Size               = size;
        }

        public static URect CalcFromCenter(Vector2 centerPoint, Vector2 size)
        {
            return new URect(new ULoc(centerPoint.X - size.X * 0.5f, centerPoint.Y - size.Y * 0.5f), new USize(size.X, size.Y));
        }

        public static URect Full
        {
            get
            {
                return new URect(new ULoc(0.0f, 0.0f), new USize(1.0f, 1.0f));
            }
        }
    }
}
